Class DiplomacyNegoClient

java.lang.Object
java.lang.Thread
es.csic.iiia.negoServer.NegotiationClient
ddejonge.bandana.negoProtocol.DiplomacyNegoClient
All Implemented Interfaces:
java.lang.Runnable

public class DiplomacyNegoClient
extends es.csic.iiia.negoServer.NegotiationClient
  • Nested Class Summary

    Nested classes/interfaces inherited from class es.csic.iiia.negoServer.NegotiationClient

    es.csic.iiia.negoServer.NegotiationClient.STATUS

    Nested classes/interfaces inherited from class java.lang.Thread

    java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String ACCEPT  
    static java.lang.String CONFIRM  
    static java.lang.String INFORM  
    static java.lang.String PROPOSE  
    static java.lang.String REJECT  

    Fields inherited from class es.csic.iiia.negoServer.NegotiationClient

    conversations

    Fields inherited from class java.lang.Thread

    MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
  • Constructor Summary

    Constructors 
    Constructor Description
    DiplomacyNegoClient​(es.csic.iiia.fabregues.dip.Player player, int port)  
    DiplomacyNegoClient​(es.csic.iiia.fabregues.dip.Player player, java.net.InetAddress negoServerAddress, int port)  
  • Method Summary

    Modifier and Type Method Description
    void acceptProposal​(java.lang.String proposalID)  
    void announceAgentName()  
    void connect()
    Connect to the BANDANA negotiation server.
    void connect​(java.lang.String name)
    This method is not implemented.
    Instead, call connect() with no arguments to connect to the negotiation server.
    void connect​(java.lang.String name, java.lang.String role)
    This method is not implemented.
    Instead, call connect() with no arguments to connect to the negotiation server.
    void connect​(java.lang.String name, java.lang.String role, java.lang.String password)
    This method is not implemented.
    Instead, call connect() with no arguments to connect to the negotiation server.
    java.util.ArrayList<? extends Deal> getConfirmedDeals()
    Returns a copy of the list of all confirmed deals.
    java.util.ArrayList<DiplomacyProposal> getUnconfirmedProposals()
    Returns a list of all proposals that have either been proposed by me, or that have been proposed to me by other powers, but that haven't been confirmed yet.
    void proposeDeal​(BasicDeal deal)  
    void receiveMessage​(es.csic.iiia.negoServer.Message msg)  
    void rejectProposal​(java.lang.String proposalID)  
    void sendInformalMessage​(java.util.List<es.csic.iiia.fabregues.dip.board.Power> receivers, java.io.Serializable messageContent)
    Send any object to any set of receivers.
    java.lang.Object waitTillReady()  

    Methods inherited from class es.csic.iiia.negoServer.NegotiationClient

    closeConnection, getRegisteredNames, getStatus, hasMessage, isReady, name, removeMessageFromQueue, run, sendFinalString, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, waitTillConnected

    Methods inherited from class java.lang.Thread

    activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • DiplomacyNegoClient

      public DiplomacyNegoClient​(es.csic.iiia.fabregues.dip.Player player, int port)
    • DiplomacyNegoClient

      public DiplomacyNegoClient​(es.csic.iiia.fabregues.dip.Player player, java.net.InetAddress negoServerAddress, int port)
  • Method Details

    • proposeDeal

      public void proposeDeal​(BasicDeal deal) throws java.io.IOException
      Throws:
      java.io.IOException
    • sendInformalMessage

      public void sendInformalMessage​(java.util.List<es.csic.iiia.fabregues.dip.board.Power> receivers, java.io.Serializable messageContent)
      Send any object to any set of receivers.
      The Notary will ignore this type of message.
      Parameters:
      receivers -
      messageContent -
    • acceptProposal

      public void acceptProposal​(java.lang.String proposalID)
    • rejectProposal

      public void rejectProposal​(java.lang.String proposalID)
    • receiveMessage

      public void receiveMessage​(es.csic.iiia.negoServer.Message msg)
      Overrides:
      receiveMessage in class es.csic.iiia.negoServer.NegotiationClient
    • getUnconfirmedProposals

      public java.util.ArrayList<DiplomacyProposal> getUnconfirmedProposals()
      Returns a list of all proposals that have either been proposed by me, or that have been proposed to me by other powers, but that haven't been confirmed yet.
      Returns:
    • getConfirmedDeals

      public java.util.ArrayList<? extends Deal> getConfirmedDeals()
      Returns a copy of the list of all confirmed deals.
      Returns:
    • connect

      public void connect()
      Connect to the BANDANA negotiation server.
    • connect

      public void connect​(java.lang.String name)
      This method is not implemented.
      Instead, call connect() with no arguments to connect to the negotiation server.
      Overrides:
      connect in class es.csic.iiia.negoServer.NegotiationClient
    • connect

      public void connect​(java.lang.String name, java.lang.String role)
      This method is not implemented.
      Instead, call connect() with no arguments to connect to the negotiation server.
      Overrides:
      connect in class es.csic.iiia.negoServer.NegotiationClient
    • connect

      public void connect​(java.lang.String name, java.lang.String role, java.lang.String password)
      This method is not implemented.
      Instead, call connect() with no arguments to connect to the negotiation server.
      Overrides:
      connect in class es.csic.iiia.negoServer.NegotiationClient
    • waitTillReady

      public java.lang.Object waitTillReady()
      Overrides:
      waitTillReady in class es.csic.iiia.negoServer.NegotiationClient
    • announceAgentName

      public void announceAgentName()